package com.example.yunJie.digitalSentry.mapper.one;



import com.example.yunJie.digitalSentry.entity.DateEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.io.Serializable;
import java.util.List;

public interface DateMapper {
//    @Insert("<script>insert into sz_date(date)\n" +
//            "        values(#{date})</script>")
    int insert(DateEntity dateEntity);

//    @Update("<script>update sz_date\n" +
//            "        <trim prefix=\"SET\" suffixOverrides=\",\">\n" +
//            "            <if test=\"date != null\">date = #{date},</if>\n" +
//            "        </trim>\n" +
//            "        where id = #{id}</script>")
    int update(DateEntity dateEntity);

//    @Delete("<script> delete from sz_date where id = #{Id}</script>")
    int deleteById(Serializable id);

//    @Delete("<script>delete from sz_date where id in\n" +
//            "        <foreach collection=\"array\" item=\"id\" open=\"(\" separator=\",\" close=\")\">\n" +
//            "            #{id}\n" +
//            "        </foreach></script>")
    int deleteIdList(List<Integer> idList);

//    @Select("<script>select  date\n" +
//            "        from sz_date\n" +
//            "        where id = #{id}</script>")
    DateEntity findId(String id);
//    @Select("<script>select * from sz_date\n" +
//            "        <where>\n" +
//            "            <if test=\"date != null and date != ''\">and date = #{date} </if>\n" +
//            "        </where></script>")
    DateEntity findByDate(String date);
//    @Select("<script>select * from sz_date\n" +
//            "        <where>\n" +
//            "            <if test=\"date != null and date != ''\">and date = #{date} </if>\n" +
//            "        </where></script>")
    List<DateEntity> findAll(DateEntity dateEntity);


}
